package com.smcdd.cdb.dbo.cdb_dbo.ui.utils;

import android.util.Log;

import java.net.URLEncoder;

/**
 * 作者：Administrator on 2017/6/9 22:59
 * 邮箱：zhanghuaiha@gmail.com
 */

public class Encode {
    public static String toURLEncoded(String paramString) {
        if (paramString == null || paramString.equals("")) {
            Log.e("toURLEncoded error:",paramString);
            return "";
        }

        try
        {
            String str = new String(paramString.getBytes(), "UTF-8");
            str = URLEncoder.encode(str, "UTF-8");
            return str;
        }
        catch (Exception localException)
        {
            Log.e("toURLEncoded error:"+paramString, localException+"");
        }

        return "";
    }
}